<admintpl file="header"/>


<link href="__TMPL__Public/assets/css/infomation.css" rel="stylesheet"/>
<style type="text/css">
    .mll2 {
        float: left;
        margin-left: 20px
    }

    .mll {
        float: left;
        margin-left: 600px
    }
</style>
</head>
<body>
<div class="wrap">
    <ul class="nav nav-tabs">
        <li><a href="{:U('WorkContactList/index')}">工作联系单管理</a></li>
        <if condition="($Role eq 2) AND ($userrole['role'] eq 5)">
            <li><a href="{:U('WorkContactList/add')}">新增工作联系单</a></li>
        </if>
        <li class="active"><a href="{:U('WorkContactList/view', array('id'=>I('request.id/s','')))}">查看工作联系单</a></li>
    </ul>
    <section class="tab-pane active fade in" id="access">
        <div class="row">
            <div class="col-xs-12 col-md-12 col-lg-12">
                <div class="panel panel-info">

                    <div class="panel-body">
                        <form method="post" class="form-horizontal " action="{:U('WorkContactList/audit_post')}">
                            <input type="hidden" name="table_id" value="{$result.id}"/>
                            <input type="hidden" name="audit_level" value="{$result.audit_level}"/>
                            <div class="row tg-header">
                                <div class="col-md-12 text-center">
                                    <h3>工作联系单</h3>
                                    <hr/>
                                </div>
                                <div>
                                    <p class="pull-right tg-serialnum"><label>编号:</label><input class="input-xt"
                                                                                                name="code"
                                                                                                value="{$result.code}"
                                                                                                readonly/></p>
                                </div>
                                <div class="col-md-12">
                                    <p class="tg-to"><label>工程名称:</label><input type="text"
                                                                                class="input-xt input-deptname" disabled
                                                                                value="{$job_name}" readonly/></p>

                                    <p class="pull-right tg-serialnum"><label>建设单位:</label><input class="input-xt"
                                                                                                  name="construction_department"
                                                                                                  value="杭州市中医院"
                                                                                                  readonly/></p>
                                </div>
                            </div>

                            <table class="table table-bordered">
                                <tr>
                                    <td style="border-right:none !important;">
                                        <p>
                                            <label>事由：</label>
                                            <textarea style="height: 200px;width: 100%"
                                                      readonly>{$result.main_content}</textarea>
                                        </p>
                                        <p class="tg-content">
                                            附件：
                                            <foreach name="results" item="vo">
                                                <div class='controls' style='margin-top:10px;margin-left:20px'>
                                                    <a target="_blank" path="{$vo.file_path}" name="{$vo.file_name}"
                                                       class="fileDownload" data-type="{$vo.file_type}"><label>{$vo.file_name}</label></a>
                                                </div>
                                            </foreach>
                                        </p>
                                        <p>
                                            <span class="mll2">项目经办：</span>
                                            <span class="mll">项目经理：</span>
                                        <div class="signature-date" style="margin-right: 200px !important">
                                            <span>{$result.publish_time|substr=0,4}&nbsp;年&nbsp;{$result.publish_time|substr=5,2}月&nbsp;{$result.publish_time|substr=8,2}日</span>
                                        </div>
                                        </p>
                                    </td>
                                </tr>
                                <if condition="$audit[3] AND $result['audit_level'] egt 5">
                                    <tr>
                                        <td colspan="4">
                                            <label>监理意见：
                                                <if condition="$audit[3][0]['audit_status'] eq '1'">
                                                    &nbsp;同意
                                                    <else/>
                                                    &nbsp;驳回
                                                </if>
                                            </label>
                                            <textarea style="height:50px; width:100%">{$audit.3.audit_reason}</textarea>
                                            <p>
                                                <span style="float: left;margin-left: 20px">负责人（签章）：</span>
                                            <div class="signature-date" style="margin-right: 200px !important">
                                                <span>年</span>
                                                <span>月</span>
                                                <span>日</span>
                                            </div>
                                            </p>
                                        </td>
                                    </tr>
                                </if>
                                <if condition="$audit[5] AND $result['audit_level'] egt 7">
                                    <tr>
                                        <td colspan="4">
                                            <label>代建意见：
                                                <if condition="$audit[5][0]['audit_status'] eq '1'">
                                                    &nbsp;同意
                                                    <else/>
                                                    &nbsp;驳回
                                                </if>
                                            </label>
                                            <textarea style="height:50px; width:100%">{$audit.5.audit_reason}</textarea>
                                            <p>
                                                <span style="float: left;margin-left: 20px">负责人（签章）：</span>
                                            <div class="signature-date" style="margin-right: 200px !important">
                                                <span>年</span>
                                                <span>月</span>
                                                <span>日</span>
                                            </div>
                                            </p>
                                        </td>
                                    </tr>
                                </if>
                                <if condition="$audit[7] AND $result['audit_level'] egt 9">
                                    <tr>
                                        <td colspan="4">
                                            <label>设计意见：
                                                <if condition="$audit[7][0]['audit_status'] eq '1'">
                                                    &nbsp;同意
                                                    <else/>
                                                    &nbsp;驳回
                                                </if>
                                            </label>
                                            <textarea style="height:50px; width:100%">{$audit.7.audit_reason}</textarea>
                                            <p>
                                                <span style="float: left;margin-left: 20px">负责人（签章）：</span>
                                            <div class="signature-date" style="margin-right: 200px !important">
                                                <span>年</span>
                                                <span>月</span>
                                                <span>日</span>
                                            </div>
                                            </p>
                                        </td>
                                    </tr>
                                </if>
                                <if condition="$audit[9] AND $result['audit_level'] egt 11">
                                    <tr>
                                        <td colspan="4">
                                            <label>建设意见：
                                                <if condition="$audit[9][0]['audit_status'] eq '1'">
                                                    &nbsp;同意
                                                    <else/>
                                                    &nbsp;驳回
                                                </if>
                                            </label>
                                            <textarea style="height:50px; width:100%">{$audit.9.audit_reason}</textarea>
                                            <p>
                                                <span style="float: left;margin-left: 20px">负责人（签章）：</span>
                                            <div class="signature-date" style="margin-right: 200px !important">
                                                <span>年</span>
                                                <span>月</span>
                                                <span>日</span>
                                            </div>
                                            </p>
                                        </td>
                                    </tr>
                                </if>
                                <if condition="$result['audit_status'] eq '2'">
                                    <tr>
                                        <td colspan="4">
                                            <label>审查意见：&nbsp;驳回</label>
                                            <textarea style="height:50px; width:100%"
                                                      readonly>{$reject.audit_reason}</textarea>
                                        </td>
                                    </tr>
                                </if>
                                <if condition="$isAudit eq '2'">
                                    <tr>
                                        <td colspan="4">
                                            <label>审查意见：
                                                <label style="width:50px;"><input type="radio" name="audit_status"
                                                                                  value="1" checked/>&nbsp;同意</label>
                                                <label style="width:50px;"><input type="radio" name="audit_status"
                                                                                  value="2"/>&nbsp;驳回</label>
                                            </label>
                                            <textarea style="height:50px; width:100%" name="audit_reason">{$audit.audit_reason}</textarea>
                                        </td>
                                    </tr>
                                </if>

                                <if condition="$is_last_user eq 1">
                                    <input type="hidden" name="last_user" value="1" id="last_user">
                                    <tr>
                                        <td colspan="4">
                                            选择设计公司
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="4">
                                            <foreach name="design_company" item="l">
                                                <label style="margin-left: 20px;" for="d_{$l.id}">
                                                    <input type="checkbox" name="departments[]"  id="d_{$l.id}" value="{$l.id}">{$l.department_name}
                                                </label>
                                            </foreach>
                                        </td>
                                    </tr>
                                </if>

                            </table>
                            <div class="form-actions">
                                <if condition="$isAudit eq '2'">
                                    <a class="btn btn-primary clickBtn" href="javascript:void(0);">{:L('SAVE')}</a>
                                </if>
                                <if condition="$result['audit_status'] eq 3">
                                    <a class="btn btn-warning" href="javascript:$.print('#access');">打印</a>
                                </if>
                                <a class="btn btn-default" href="{:U('WorkContactList/index')}">{:L('BACK')}</a>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </section>
</div>
<script src="__PUBLIC__/js/common.js"></script>
<script type="text/javascript" src="__TMPL__Public/assets/js/audit.js"></script>
<script type="text/javascript">
    $(document).ready(function (e) {
        window.obj = '';
        // 选择图片
        $(document).on("click", ".upBtn", function (e) {
            window.obj = $(this);
            $("#upFile").click();
        });
        // 文件选择器change事件
        $("#upFile").on("change", function () {
            UploadFile("{:U('WorkContactList/upload')}", "work_contact_list");
        });
        $(document).on("click", ".delFile", function () {
            if ($(this).attr("value") != undefined) {
                delFile("{:U('WorkContactList/delFile')}", $(this).attr("value"), $(this))
            } else {
                $(this).closest("div").remove();
            }
        });
    });
</script>
</body>
</html>